package homework0301;

public class MatchDemo2 {
    public static void main(String[] args) {
        String email="fdsa@tedu.com";
        String regex="[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean match=email.matches(regex);
        if (match){
            System.out.println("格式正确");
        }else {
            System.out.println("格式错误");
        }
    }
}
